package com.gyg.controller;


import com.gyg.returns.RespEntity;
import com.gyg.service.CloudMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 短信验证码表 前端控制器
 * </p>
 *
 * @author gyg
 * @since 2021-02-20
 */
@RestController
@RequestMapping("/cloud-msg")
@Slf4j
@Api(value = "短信模块", tags = "短信模块")
public class CloudMsgController {

    @Resource
    private CloudMsgService cloudMsgService;

    @GetMapping("/send")
    @ApiOperation(value = "发送短信验证码")
    @ApiImplicitParam(paramType = "query", dataType = "String", name = "mobile", value = "手机号", required = true)
    public RespEntity<Integer> sendMsg(@RequestParam(value = "mobile", required = true) String mobile) {
        RespEntity<Integer> respEntity = cloudMsgService.sendMsg(mobile);
        return respEntity;
    }

}
